import React, { Component } from 'react'
import { Route, Redirect, Switch } from 'react-router-dom'
import { adminRoutes } from './routes'
import { Button } from 'antd'

export default class App extends Component {
    render() {
        return (
            <div>
               <Button type="danger"> 按钮</Button>
              <Switch>
                  {
                      adminRoutes.map(item =>{
                          console.log(item)
                          return <Route 
                          key={item.path} 
                          path={item.path} 
                          component={item.component}
                          exact={ item.exact}/>
                      })
                  }
                  <Redirect from="/admin" to="/admin/home" exact />
                  <Redirect to="/404" />
              </Switch>
            </div>
        )
    }
}
